using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Terra.Core.Common.ApiResponse;
using Terra.Core.Common.Models.Common;
using Terra.Core.Common.Models.Pagination;
using Terra.Data.Models.Identity;

namespace Terra.Service.Identity.Interfaces;

/// <summary>
/// 菜单服务接口
/// </summary>
public interface IMenuService
{
    /// <summary>
    /// 获取菜单详情
    /// </summary>
    /// <param name="id">菜单ID</param>
    /// <returns>菜单详情</returns>
    Task<ApiResponse<MenuDetailDto>> GetMenuByIdAsync(Guid id);

    /// <summary>
    /// 获取菜单分页列表
    /// </summary>
    /// <param name="query">查询条件</param>
    /// <returns>分页列表</returns>
    Task<ApiResponse<PagedList<MenuItemDto>>> GetPagedMenusAsync(MenuQueryDto query);

    /// <summary>
    /// 获取菜单树形结构
    /// </summary>
    /// <returns>树形菜单列表</returns>
    Task<ApiResponse<List<MenuTreeDto>>> GetMenuTreeAsync();

    /// <summary>
    /// 获取菜单选择列表
    /// </summary>
    /// <returns>菜单选择列表</returns>
    Task<ApiResponse<List<MenuSelectDto>>> GetMenuSelectListAsync();

    /// <summary>
    /// 创建菜单
    /// </summary>
    /// <param name="dto">创建信息</param>
    /// <returns>操作结果</returns>
    Task<ApiResponse<Guid>> CreateMenuAsync(MenuCreateDto dto);

    /// <summary>
    /// 更新菜单
    /// </summary>
    /// <param name="id">菜单ID</param>
    /// <param name="dto">更新信息</param>
    /// <returns>操作结果</returns>
    Task<ApiResponse> UpdateMenuAsync(Guid id, MenuUpdateDto dto);

    /// <summary>
    /// 删除菜单
    /// </summary>
    /// <param name="id">菜单ID</param>
    /// <returns>操作结果</returns>
    Task<ApiResponse> DeleteMenuAsync(Guid id);

    /// <summary>
    /// 批量删除菜单
    /// </summary>
    /// <param name="dto">批量删除参数</param>
    /// <returns>操作结果</returns>
    Task<ApiResponse<BatchOperationResult>> BatchDeleteMenusAsync(BatchDeleteDto<Guid> dto);

    /// <summary>
    /// 获取前端路由菜单树
    /// </summary>
    /// <returns>前端路由菜单</returns>
    Task<ApiResponse<List<RouterMenuDto>>> GetRouterMenuTreeAsync();
}